<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableSendlogs extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('sendlogs', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('o_id')->comment('订单表id');
			$table->string('order_id', 120)->comment('订单id');
			$table->integer('map_id')->comment('渠道与活动关联id');
			$table->integer('send_id')->comment('该记录的隶属用户id');
			$table->integer('wx_id')->default(-1)->comment('该记录的中奖id');
			$table->string('unique', 25)->comment('分享唯一码');
			$table->integer('nums')->default(10)->comment('总可抽奖次数');
			$table->integer('win')->comment('中奖号码');
			$table->text('products')->nullable()->comment('商品信息');
			$table->boolean('read')->default(false)->comment('是否弹窗');
			$table->dateTime('create_time')->comment('创建时间');
			$table->dateTime('expore_time')->comment('过期时间');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('sendlogs');
	}
}
